package com.kajdo.notes.converter;

public class CalendarEntry {
	public static String OUT_TAB_HEADER = "Betreff\t" +
			"Beginnt am\t" +
			"Beginnt um\t" +
			"Endet am\t" +
			"Endet um\t"+
			"Erforderliche Teilnehmer\t"+
			"Beschreibung\t"+
			"Ort";
	
	private String owner;
	private String startDateTime;
	private String endDateTime;
	private String subject;
	private String location;
	private String desc;
	
	
	public String getOUT_CSV_String(){
		String str = new String();
		
		str = getSubject()+"\t"
			+getStartDateTime().substring(0,10)+"\t"
			+getStartDateTime().substring(11,19)+"\t"
			+getEndDateTime().substring(0,10)+"\t"
			+getEndDateTime().substring(11,19)+"\t"
			+getOwner()+"\t"
			+"\""+getDesc()+"\"\t"
			+getLocation();
			
		return str;
	}
	
	public String getOwner() {
		return owner;
	}
	public void setOwner(String owner) {
		this.owner = owner;
	}
	public String getStartDateTime() {
		return startDateTime;
	}
	public void setStartDateTime(String startDateTime) {
		if (startDateTime.length() > 19) this.startDateTime = startDateTime.substring(0, 19); 
		else this.startDateTime = startDateTime;
	}
	public String getEndDateTime() {
		return endDateTime;
	}
	public void setEndDateTime(String endDateTime) {
		if (endDateTime.length() > 19) this.endDateTime = endDateTime.substring(0, 19); 
		else this.endDateTime = endDateTime;
	}
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public String getDesc() {
		char toReplace = '"';
		String str = ""+desc;
		
		return str.replace(toReplace, ' ');
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
}
